﻿using System;
using System.ComponentModel;
using System.Linq.Expressions;

namespace AuchanScan.Models
{
    public class AuchanPushPin : INotifyPropertyChanged
    {


        #region INotifyPropertyChanged immplementation
        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        protected void OnPropertyChanged<T>(Expression<Func<T>> expression)
        {
            if (!(expression.Body is MemberExpression))
                return;

            MemberExpression memberExpression = (MemberExpression)expression.Body;
            string propertyName = memberExpression.Member.Name;
            OnPropertyChanged(propertyName);
        }
        #endregion
        
    }
}
